<?php

/**
 * Created by PhpStorm.
 * User: lihao
 * Date: 2017/9/8
 * Time: 下午3:58
 */
class Movie_model extends CI_Model
{
    public function movies($page = 0) {
        if ($page != 0) {
            $this->db->limit(20, ($page - 1) * 20);
        }
        $this->db->where("thunders != ''");
        return $this->db->get('movies')->result_array();
    }

    public function detail($id) {
        $this->db->where("id = ".$id);
        return $this->db->get('movies')->result_array()[0];
    }
}